# Maintainer: Santiago Torres-Arias <santiago@archlinux.org>

pkgname=python-securesystemslib
pkgver=0.23.0
pkgrel=2
pkgdesc="Cryptographic and general-purpose routines for Secure Systems Lab projects at NYU"
arch=('any')
license=('MIT')
url="https://github.com/secure-systems-lab/securesystemslib"
depends=('python-cryptography' 'python-pynacl' 'python-colorama' 'python-six' 'python-dateutil')
makedepends=('python-setuptools' 'git')
source=("git+https://github.com/secure-systems-lab/securesystemslib.git?signed#tag=v${pkgver}")

sha512sums=('SKIP')

validpgpkeys=(
    "C2FB9C910758B6827BC43233BC0C6DEDD5E5CC03"
    # Sebastien Awwad (upstream co-maintainer)
    "8BA69B87D43BE294F23E812089A2AD3C07D962E8"
    # Lukas Puehringher (upstream maintainer)
    "903BAB73640EB6D65533EFF3468F122CE8162295"
    # Santiago Torres-Arias <santiago@archlinux.org> (upstream co-maintainer)
    "08F3409FCF71D87E30FBD3C21671F65CB74832A4"
    # Joshua Lock (GPG on YubiKey) <jlock@vmware.com> (upstream co-maintainer)
    )

build() { 
    cd "${srcdir}/securesystemslib"
    python setup.py build
}

package_python-securesystemslib() {

    cd "securesystemslib"
    python setup.py install --root="${pkgdir}/" --optimize=1
    install -D -m0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

check() {
    cd "securesystemslib/tests/"
    PYTHONPATH=.. python aggregate_tests.py
}
